home *** CD-ROM | disk | FTP | other *** search
/ Hackers Handbook - Millenium Edition / Hackers Handbook.iso / library / hack99 / nt_system_policies.txt < prev    next >
Encoding:
Internet Message Format  |  1999-03-24  |  5.8 KB

  1. Date: Wed, 3 Feb 1999 22:41:52 -0000
  2. From: mnemonix <mnemonix@GLOBALNET.CO.UK>
  3. To: BUGTRAQ@netspace.org
  4. Subject: Inherent weaknesses in NT system policies
  5.  
  6. There are certain key vulnerabilities in NT's System Policies that allow
  7. most restrictions to be by-passed. For instance, although Registry Editing
  8. tools can be disabled this restriction can be avoided with ease, but more on
  9. that later.
  10.  
  11. Consider a restrictive user System Policy where the user's shell is
  12. Explorer.exe and it only allows the Microsoft Word application (winword.exe)
  13. to be run. It is launched from an icon on the desktop. This is the only icon
  14. present. So the user can perform their work, write documents and save them,
  15. they are give write NTFS permissions only to their profile directory. The
  16. Registry editing tools have been disabled.
  17.  
  18. This policy can be broken in a matter of minutes:
  19.  
  20. On running MS Word a user clicks on File on the Menu Bar, and goes down to
  21. Open. They are shown a list of directories and files. The user could try to
  22. right click on a folder and go down to Explore but the right-click menu has
  23. been disabled; So instead they drag a folder to the Start Button on the
  24. Taskbar and release. This will place a shortcut to that folder on the Start
  25. Menu. This shortcut will be stored in their profile directory. On clicking
  26. on it, Explorer is opened up, which not normally have direct (ie non-shell)
  27. access to. The default WINNT directory has been hidden from view by the
  28. system policy - however, by clicking on Tools on the Explorer Menu Bar they
  29. choose Go To and enter the path to the WINNT directory. On pressing enter
  30. the WINNT directory appears as if from no-where. The user then changes to
  31. the SYSTEM32 directory where most of the applications are stored. Because,
  32. however, winword.exe is the only approved application there would be little
  33. point in attempting to run any of them. Instead the user highlights the NT
  34. Command Prompt executable (cmd.exe) and copies it, by using the Copy option
  35. found under Edit on the Menu Bar. He then pastes it to his profile directory
  36. and then renames it to winword.exe. Once it has been renamed the user can
  37. run it.
  38.  
  39. Once cmd.exe is running as winword.exe any application can be run from here
  40. without restriction save for the Registry Editing tools. This happens
  41. because the policy restrictions only apply to the user's shell and not to
  42. any other running application. The app is started from cmd.exe (masqueading
  43. as winword) and not Explorer neatly by-passing the allowable applications
  44. restriction.
  45.  
  46. What is interesting to note, however, is that if only the file name is
  47. supplied eg file.txt notepad will not be launched and an Access Denied
  48. message will be returned. This is because cmd.exe must reference Explorer,
  49. which is the user shell with all the restrictions, to see what application
  50. is associated with the .txt extention. Consequently Notepad would be
  51. launched from Explorer, in this case, and not the Command Prompt, even
  52. though  it initated the process.
  53.  
  54. What about the Registry? How can restrictions placed on this be by-passed.
  55. This is done with the use of .reg files. .reg files are text files that
  56. contain entries that are used to change registry settings. Below is a sample
  57. .reg file:
  58.  
  59. NORUN.REG
  60. ---------------------------------
  61. REGEDIT4
  62.  
  63. [HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explor
  64. er]
  65. "NoRun"=dword:0
  66. ---------------------------------
  67.  
  68. By default the .reg file extention is associated with Regedit.exe with a
  69. default action of Merge, in other words update the Registry. So when a .reg
  70. file is double clicked the registry will be updated providing the user has
  71. the necessary permissions to the Registry Key specified in the file.
  72.  
  73. Even if Registry editing tools have been disabled with a System Policy, when
  74. a .reg file is clicked on, the Registry Key(s) and Values will still be
  75. modified. This blows away the whole point of having this restriction.
  76.  
  77. Even if .reg has be dis-associated from Regedit.exe, by default a normal
  78. user has the relevant permissions to re-associate it. This is done from the
  79. Folder Options option found under View on the Explorer Menu Bar.
  80.  
  81. All a user then needs do is make a copy of regedit.exe, rename it to
  82. winword.exe and then associate the .reg extention with the path to the
  83. regedit winword.exe. They can then create their own .reg file using the real
  84. winword and save it to their profile directory. Needless to say the user
  85. must know the exact Registry Key path they wish to modify and the value the
  86. wish to tweak.
  87.  
  88. To stop this from happening the Administrator should only give Admins access
  89. to regedit.exe and regedt32.exe using NTFS file permissions and deny access
  90. to everyone else. Some may go as far as wanting to delete them completely,
  91. but this could lead to support issues if they were needed at some point by
  92. Helpdesk staff.
  93.  
  94. As can be seen, even a restrictive but at least useable System Policy can
  95. thus be broken. It is not simply enough to create a policy. A lot more work
  96. needs to go into this if Admins wish to limit and restict what their users
  97. can and cannot do.
  98.  
  99. -----------------------------------------------------------------------------
  100.  
  101. Date: Fri, 19 Feb 1999 11:25:14 -0700
  102. From: Kurt Seifried <listuser@SEIFRIED.ORG>
  103. To: BUGTRAQ@netspace.org
  104. Subject: Re: Inherent weaknesses in NT system policies
  105.  
  106. As any good little MCSE learns:
  107.  
  108. Give the full pathname to the programs you want to allow them to run. This
  109. makes it a lot safer. There are ways around even this of course. NT is not
  110. secure against a determined user, just boot from a floppy and replace the
  111. registry if you really want to. I haven't looked in depth yet but MSIE 5.0
  112. comes with it's own policy restrictions/etc (quite a few actually), I'm not
  113. 100% sure how they interact with NT's user policies/etc, but once I get a
  114. chance to play with it some more I'll post that up.
  115.  
  116. -seifried, MCSE
  117. https://www.seifried.org/
  118.  
  119.